﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/TwoCols.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<TinyPMS_Jerusalem.Models.DBModel.Property>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	物品列表
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="WidgetTitleContent" runat="server">
	所有物品
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <table cellpadding="0" cellspacing="0" class="datatable">
    <thead>
        <tr>
            <th></th>
            <th>
                物品编号
            </th>
            <th>
                物品名称
            </th>
            <th>
                物品简介
            </th>
            <th>
                是否已借出
            </th>
            <th>
                物品分类
            </th>
            <th>
                物品分类标签
            </th>
            <th>
                物品最大续借次数
            </th>
            <th>
                物品标记价格
            </th>
            <th>
                物品一次借出最长时间（天）
            </th>
        </tr>
    </thead>

    <% foreach (var item in Model) { %>
    
        <tr>
            <td>
                <%= Html.ActionLink("详细信息", "Details", new { id=item.ID })%>
                <% if(User.IsInRole("Admin")){ %>
                 |
                <%= Html.ActionLink("编辑", "Edit", "PropertyAdmin", new { id = item.ID },"")%> |
                <%= Html.ActionLink("删除", "Delete", "PropertyAdmin" , new { id = item.ID },"")%>
                <%} %>
            </td>
            <td>
                <%= Html.Encode(item.ID) %>
            </td>
            <td>
                <%= Html.Encode(item.Name) %>
            </td>
            <td>
                <%= Html.Encode(item.Introduction) %>
            </td>
            <td>
                <%= Html.Encode(item.Status) %>
            </td>
            <td>
                <%= Html.Encode(item.Category) %>
            </td>
            <td>
                <%= Html.Encode(item.Tags) %>
            </td>
            <td>
                <%= Html.Encode(item.MaxRenewCount) %>
            </td>
            <td>
                <%= Html.Encode(item.Price) %>
            </td>
            <td>
                <%= Html.Encode(item.Duration) %>
            </td>
        </tr>
    
    <% } %>

    </table>

    <p>
        <%= Html.ActionLink("创建新物品", "Create","PropertyAdmin") %>
    </p>

</asp:Content>

